package com.water.controller;

import com.water.entity.SyEmp;
import com.water.entity.SyEmpareapower;
import com.water.service.SyEmpService;
import com.water.service.SyEmpareapowerService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * (SyEmpareapower)表控制层
 *
 * @author makejava
 * @since 2020-12-14 19:19:01
 */
@Controller
@RequestMapping("syEmpareapower")
public class SyEmpareapowerController {
    /**
     * 服务对象
     */
    @Resource
    private SyEmpareapowerService syEmpareapowerService;

    @Resource
    private SyEmpService syEmpService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public SyEmpareapower selectOne(Integer id) {
        return this.syEmpareapowerService.queryById(id);
    }

    /**
     * 跳转到片区权限
     * @param syEmp
     * @param model
     * @return
     */
    @RequestMapping(value = "sys_areapower",method = RequestMethod.GET)
    public String sys_menupower(SyEmp syEmp, Model model){
        syEmp.setDisabled(0);
        List<SyEmp> syempList= this.syEmpService.queryAll(syEmp);
        System.out.println(syempList);
        model.addAttribute("list",syempList);
        return "sys/sys_areapower";
    }

}